#include <board.h>
#include <utility/trace.h>
#include <FreeRTOS.h>
#include <task.h>
#include "pio_it_rtos.h"
#include "usb_task.h"
#include "dem_task.h"
#include "cmd_task.h"

void vApplicationMallocFailedHook(void)
{
	TRACE_FATAL("Heap size too small!\n\r");
}

int main()
{
	TRACE_CONFIGURE(DBGU_STANDARD, 115200, BOARD_MCK);
	printf("-- Opel Astra-H CarPC Project %s --\n\r", SOFTPACK_VERSION);
	printf("-- Board: %s Compiled: %s %s --\n\r", BOARD_NAME, __DATE__, __TIME__);

	// If they are present, configure Vbus & Wake-up pins
	PIO_InitializeInterrupts(0);

	USBTask_Init();
	CMDTask_Init();
	DemoTask_Init();

	vTaskStartScheduler();

	return 0;
}
